package socket.server;

import model.Game;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by admin
 * <p>
 * Date :2020/10/15
 * <p>
 * Description :
 * <p>
 * Version :1.0
 */
public class GoldenFlowerNioGame {
    private static final Logger logger = LoggerFactory.getLogger(GoldenFlowerNioGame.class);
    private static Map<String, Object> users = new HashMap();
    private static Game game = new Game();

    public static void main(String[] args) {
        try {
            server();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private static void server() throws IOException {
        ServerSocket serverSocket = new ServerSocket(10086);
        while(true){
            Socket socket = serverSocket.accept();
            new ConnectHandler(socket, game).start();
        }
    }

}
